package cs6238.common;

public class Guard {
	
	/**
	 * Checked exceptions have their place, but they annoy me sometimes
	 * @param condition
	 * @param message
	 */
	public static void that(boolean condition, String message){
		if(!condition){
			throw new IllegalStateException(message);
		}
	}

	public static void NoNullArguments(Object ... objects) {
		for(int i=0; i< objects.length; i++){
			if(objects[i] == null){
				throw new IllegalStateException("This function can not take null arguments");
			}
		}
		
	}

}
